1. Field of the Invention
This invention relates generally to methods and apparatus for improving computer performance and more specifically to improving the distribution of read requests to multiple storage media of a redundant array of inexpensive disks (RAID) system.
2. Description of the Related Art
The operating system (OS) of a computer controls the delivery of read requests to a storage medium. For example, in the case of a RAID mirroring implementation, where multiple storage disks are employed, the OS will send the read requests to the queue of a primary drive until that drive is full. When the queue of the primary drive is full, the read requests are held until the queue for the primary drive is decreased. Therefore, the OS is forced to wait until the primary drive processes read commands to free up capacity in the queue.
FIG. 1 illustrates block diagram 100 depicting how read-commands are handled in the prior art for a software redundant array of inexpensive disks (RAID) implementation. An application 102 requires data and notifies the operating system (OS) 104. The operating system 104 issues a read command to a RAID driver 106. In the case of RAID level 1 (mirroring), the read commands are sent to the primary drive D1108 from the RAID driver 106. As more read commands are issued from the operating system 104, the read commands are queued for the primary drive D1108. For example, the drive D1108 has a random access memory (RAM) in which tagged command queing is performed. The read commands continue to accumulate until the queue for D1108 reaches a full level. While the drive D1108 can theoretically queue up to 256 commands, typically the drive issues a queue full message to stop sending additional read commands after 16, 32 or 64 commands have been queued. When the drive D1108 issues a queue full message, the read commands are held until the drive D1108 sends a response that a read command has been processed. Since the drive is much slower than the CPU, because of the physical limitations of the mechanical activity of the drive, the drive becomes the main bottleneck. The OS is continually issuing more commands, but the primary disk is unable to provide the desired throughput.
FIG. 2 illustrates block diagram 112 depicting how read commands are handled in the prior art for a hardware RAID implementation. FIG. 2 is substantially similar to FIG. 1 except that a RAID controller 114 replaces a RAID driver. The RAID controller 114 includes firmware 116 which directs the read commands to the primary drive D1108. Similar to FIG. 1, the commands are queued in the RAM of the primary drive D1108. Accordingly, the same bottleneck exists. Furthermore, it should be appreciated that while write commands are issued to primary drive D1108 and secondary drive D2110, especially in the case of RAID level 1 (mirroring), the read commands are only issued to the primary drive D1108.
Under the configurations of FIGS. 1 and 2, the primary drive is exercised much more than the secondary drive. Therefore, the excessive wear and tear on the primary drive contributes to a higher probability of failure than the secondary drive. Consequently, a shorter mean time between failures (MTBF) is encountered for the primary drive. Additionally, the prior art systems as described in FIGS. 1 and 2 write to both the primary and secondary drives for a RAID level 1 (mirroring) system. However, the reads are all performed through the primary drive. Accordingly, there is no built-in check to verify if the writes to the secondary drive went in correctly.
As a result, there is a need to solve the problems of the prior art to balance the read commands evenly between multiple drives to enhance performance and disk reliability.